Component({
  data: {
    selected: 0,
    color: "#888",
    selectedColor: "#1b8c80",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "../pages/images/foot1.png",
      selectedIconPath: "../pages/images/foot1_.png",
      text: "订单管理"
    }, {
      pagePath: "/pages/classify/classify",
      iconPath: "../pages/images/foot2.png",
      selectedIconPath: "../pages/images/foot2_.png",
      text: "产品管理"
    }, {
      pagePath: "/pages/peoplePage/peoplePage",
      iconPath: "../pages/images/foot3.png",
      selectedIconPath: "../pages/images/foot3_.png",
      text: "客户管理"
    }, {
      pagePath: "/pages/personalstore/personalstore",
      iconPath: "../pages/images/foot4.png",
      selectedIconPath: "../pages/images/foot4_.png",
      text: "店铺管理"
    }]
  },
  attached() {},
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
      console.log(this.data)
    },
    sode() {
      wx.scanCode({
        success(res) {
          console.log(res)
          wx.request({
            url: res.result,
            method: 'POST',
            header: {
              Authorization: wx.getStorageSync('token')
            },
            success(res) {
              console.log(res)
              res.data.data.service.coupon.postscript = ''
              wx.navigateTo({
                url: '/pages/bindingShop/bindingShop?string=' + JSON.stringify(res.data.data),
              })
            }
          })
        }
      })
    }
  }
})